#include <pthread.h>
#include <stdio.h>
#include <string.h>

void* thread_func(void* arg) {
    pthread_t tid = pthread_self();

    if (pthread_setname_np(tid, "MyThread") != 0) {
        perror("pthread_setname_np");
    }


    return NULL;
}

int main() {
    pthread_t thread;
    pthread_create(&thread, NULL, thread_func, NULL);
    pthread_join(thread, NULL);
    return 0;
}